{extend name="public/base" /}

{block name="title"}<title>Checkbox</title>{/block}

{block name="pjax_container"}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#tab1" data-toggle="tab">{:lang('preview')}</a></li>
                    <li><a href="#tab2" data-toggle="tab">{:lang('code')}</a></li>
                    <li><a href="#tab3" data-toggle="tab">{:lang('help')}</a></li>
                    <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm"><i class="fa fa-list"></i> {:lang('back')}</a></li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="tab1">
                        <form class="form-horizontal">
{:widget('common/Checkbox/index', [$data, [
    'name' => 'flag',
    'title' => '属性',
    'from' => 'selectlist',
    'fromcfg' => 'flag',
    'validate' => 'validate',
]])}

{:widget('common/Checkbox/index', [$data, [
    'name' => 'flags',
    'title' => '属性s',
    'from' => 'selectlist',
    'fromcfg' => 'flag',
]])}

{:widget('common/Checkbox/index', [$data, [
    'name' => 'flag',
    'title' => '属性',
    'from' => 'selectlist',
    'fromcfg' => 'flag',
    'disabled' => 'disabled',
]])}

{:widget('common/Checkbox/index', [$data, [
    'name' => 'checkbox2',
    'title' => 'checkbox挂件',
    'from' => 'function',
    'fromcfg' => ['whether', 'P'],
    'validate' => '我的选项来自function，并且我终于能传参数了'
]])}

{:widget('common/Checkbox/index', [$data, [
    'name' => 'flag',
    'title' => '属性',
    'from' => 'selectlist',
    'fromcfg' => 'flag',
    'validate' => '我的小尾巴可爱吗？',
    'title_col' => '3',
    'content_col' => '3',
    'validate_col' => '6',
]])}
                        </form>
                    </div>
                    <div class="tab-pane" id="tab2">
                        <pre>
{literal}
{:widget('common/Checkbox/index', [$data, [
    'name' => 'flag',
    'title' => '属性',
    'from' => 'selectlist',
    'fromcfg' => 'flag',
    'validate' => 'validate',
]])}

{:widget('common/Checkbox/index', [$data, [
    'name' => 'flags',
    'title' => '属性s',
    'from' => 'selectlist',
    'fromcfg' => 'flag',
]])}

{:widget('common/Checkbox/index', [$data, [
    'name' => 'flag',
    'title' => '属性',
    'from' => 'selectlist',
    'fromcfg' => 'flag',
    'disabled' => 'disabled',
]])}

{:widget('common/Checkbox/index', [$data, [
    'name' => 'checkbox2',
    'title' => 'checkbox挂件',
    'from' => 'function',
    'fromcfg' => ['whether', 'P'],
    'validate' => '我的选项来自function，并且我终于能传参数了'
]])}

{:widget('common/Checkbox/index', [$data, [
    'name' => 'flag',
    'title' => '属性',
    'from' => 'selectlist',
    'fromcfg' => 'flag',
    'validate' => '我的小尾巴可爱吗？',
    'title_col' => '3',
    'content_col' => '3',
    'validate_col' => '6',
]])}
{/literal}
                        </pre>
                    </div>
                    <div class="tab-pane" id="tab3">
                        <pre>
{literal}
{:widget('common/Checkbox/index', [$data, [
    'name' => 'flag',                   //组件标签name属性值，对应数据库字段【必须】
    'title' => 'flag',                  //组件标题【必须】
    'from' => 'selectlist',             //select选项来源【必须其中一项：selectlist,function】
    'fromcfg' => 'flag',                //数据来源配置【必填，配合from使用】
    'title_col' => '2',                 //标题占比（默认2）【非必须】
    'content_col' => '6',               //内容占比（默认6）【非必须】
    'validate' => 'validate',           //提示信息【非必须】
    'validate_col' => '4',              //提示信息占比（默认4）【非必须】
    'disabled' => 'disabled',           //禁用【非必须】
]])}
{/literal}
                        </pre>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
{/block}